package com.duxd.springsecurityfinal.springsecurityfinal.mvc.controller;

import com.duxd.springsecurityfinal.springsecurityfinal.response.Response;
import com.duxd.springsecurityfinal.springsecurityfinal.response.ResponseBuild;
import org.springframework.boot.web.servlet.error.ErrorController;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * @author dong
 * @date 2022/1/18 0018
 * request not mapped controller
 */

@RestController
@RequestMapping("${server.error.path:${error.path:/error}}")
public class DefaultErrorController implements ErrorController {

    @RequestMapping(produces = {"application/json;charset=UTF-8"})
    public Response<String> error(){
        return ResponseBuild.request_404.data("404!");
    }
}
